#ifndef ADVERTISING_H
#define ADVERTISING_H

#include <QMainWindow>
#include <QWidget>
#include<QDebug>
#include<QDir>
#include<QProcess>
#include<QTimer>
#include <QPixmap>
#include<QTime>
#include<QtNetwork/QTcpServer>
#include<QtNetwork/QTcpSocket>
#include<QtNetwork/QHostAddress>
#include"mclient.h"
#include <QPushButton>
#include <QVBoxLayout>
#include <QSlider>
#include"product.h"
#include"mclient.h"


namespace Ui {
class advertising;
}

class advertising : public QMainWindow
{
    Q_OBJECT

public:
    explicit advertising(QWidget *parent = 0);
    ~advertising();
    //QString equipment_num_label;
   QString equipment_num_final;
private slots:
    void showNextImage();
    void updateTime();
    void onButtonClicked(int index);
    void on_click_to_buy_clicked();

private:
    Ui::advertising *ui;
    // 假设这些变量是某个类的成员变量
    QStringList imagePaths; // 存储图片路径的列表
    int currentIndex = 0;   // 当前显示的图片索引
    QTimer *timer;          // 用于定时切换图片的QTimer
    void showImage(int index);
    QTimer *timer_clock;
    void direct();
    //void accessParentFunctionAndData();
    void add_auto_button(int imageNum);
    QList<QPushButton*> buttons; // 用于存储动态创建的按钮
    void updateButtonStyles(int index);
   //QTcpSocket *socket_advertising;
    product *m_product;
};

#endif // ADVERTISING_H
